<!-- 轮播图 -->
<template>
    <van-swipe :autoplay="autoplay" :loop="loop" :show-indicators="showIndicators" :indicator-color="indicatorColor">
        <van-swipe-item v-for="(item,i) in swiperList" :key="i">
            <slot name="item" :items="item"></slot>
        </van-swipe-item>
    </van-swipe>
</template>

<script>
import { ref, reactive, getCurrentInstance, inject } from 'vue';
import { Swipe, SwipeItem } from 'vant';
export default {
    components:{
        [Swipe.name]: Swipe,
        [SwipeItem.name]: SwipeItem,
    },
    props: {
        autoplay: {
            default: 3000,
        },
        loop: {
            default: true,
        },
        showIndicators: {
            default: false,
        },
        indicatorColor: {
            default: 'white'
        },
    },
    setup() {
        const { proxy } = getCurrentInstance(); 
        console.log(proxy.$props.swiperList,'swiperList')
        const swiperList = inject('swiper');
        console.log(swiperList,'swiperlist')
        return {
            swiperList,
        }
    }
}

</script>
<style scoped>

</style>